﻿using System;
using System.Data;

namespace Shopping.Entities
{
    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The Info class for the ProductsInfo
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public class ProductsInfo
    {
        private string _alia = "";
        private int _available;
        private int _buy;
        private int _count;
        private string _coverType = "";
        private string _createBy = "";
        private DateTime _createDate;
        private string _description = "";
        private DateTime _displayDate;
        private short _episode;
        private int _id;
        private bool _isFilter;
        private bool _isHot;
        private string _languageId = "";
        private DateTime _lastestBuy;
        private DateTime _lastestUpdate;
        private string _name = "";
        private decimal _orginizePrice;
        private int _pagesCount;
        private int _parentId;
        private decimal _price;
        private double _promotionPercent;
        private DateTime _publishDate;
        private string _publisherId = "";
        private string _size = "";
        private int _star;
        private string _tag = "";
        private string _thumbnail = "";
        private byte _type;
        private int _view;
        private int _voteCount;
        private int _weight;
        private bool _status;

        #region Constructors

        // initialization

        #endregion

        #region Public Properties

        /// <summary>
        /// Get and Set Property Data of File column Id in Table Products 
        /// </summary>
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Name in Table Products 
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Alias in Table Products 
        /// </summary>
        public string Alia
        {
            get { return _alia; }
            set { _alia = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column PagesCount in Table Products 
        /// </summary>
        public int PagesCount
        {
            get { return _pagesCount; }
            set { _pagesCount = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column PublisherId in Table Products 
        /// </summary>
        public string PublisherId
        {
            get { return _publisherId; }
            set { _publisherId = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column LanguageId in Table Products 
        /// </summary>
        public string LanguageId
        {
            get { return _languageId; }
            set { _languageId = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column CoverType in Table Products 
        /// </summary>
        public string CoverType
        {
            get { return _coverType; }
            set { _coverType = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Size in Table Products 
        /// </summary>
        public string Size
        {
            get { return _size; }
            set { _size = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Weight in Table Products 
        /// </summary>
        public int Weight
        {
            get { return _weight; }
            set { _weight = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Star in Table Products 
        /// </summary>
        public int Star
        {
            get { return _star; }
            set { _star = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column VoteCount in Table Products 
        /// </summary>
        public int VoteCount
        {
            get { return _voteCount; }
            set { _voteCount = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Description in Table Products 
        /// </summary>
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column OrginizePrice in Table Products 
        /// </summary>
        public decimal OrginizePrice
        {
            get { return _orginizePrice; }
            set { _orginizePrice = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Price in Table Products 
        /// </summary>
        public decimal Price
        {
            get { return _price; }
            set { _price = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column PublishDate in Table Products 
        /// </summary>
        public DateTime PublishDate
        {
            get { return _publishDate; }
            set { _publishDate = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Views in Table Products 
        /// </summary>
        public int View
        {
            get { return _view; }
            set { _view = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Buys in Table Products 
        /// </summary>
        public int Buy
        {
            get { return _buy; }
            set { _buy = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Tags in Table Products 
        /// </summary>
        public string Tag
        {
            get { return _tag; }
            set { _tag = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column CreateBy in Table Products 
        /// </summary>
        public string CreateBy
        {
            get { return _createBy; }
            set { _createBy = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column CreateDate in Table Products 
        /// </summary>
        public DateTime CreateDate
        {
            get { return _createDate; }
            set { _createDate = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column LastestUpdate in Table Products 
        /// </summary>
        public DateTime LastestUpdate
        {
            get { return _lastestUpdate; }
            set { _lastestUpdate = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column IsHot in Table Products 
        /// </summary>
        public bool IsHot
        {
            get { return _isHot; }
            set { _isHot = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column IsFilter in Table Products 
        /// </summary>
        public bool IsFilter
        {
            get { return _isFilter; }
            set { _isFilter = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column DisplayDate in Table Products 
        /// </summary>
        public DateTime DisplayDate
        {
            get { return _displayDate; }
            set { _displayDate = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Status in Table Products 
        /// </summary>
        public bool Status
        {
            get { return _status; }
            set { _status = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Count in Table Products 
        /// </summary>
        public int Count
        {
            get { return _count; }
            set { _count = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Available in Table Products 
        /// </summary>
        public int Available
        {
            get { return _available; }
            set { _available = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column LastestBuy in Table Products 
        /// </summary>
        public DateTime LastestBuy
        {
            get { return _lastestBuy; }
            set { _lastestBuy = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column ParentId in Table Products 
        /// </summary>
        public int ParentId
        {
            get { return _parentId; }
            set { _parentId = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Episode in Table Products 
        /// </summary>
        public short Episode
        {
            get { return _episode; }
            set { _episode = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Type in Table Products 
        /// </summary>
        public byte Type
        {
            get { return _type; }
            set { _type = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Thumbnail in Table Products 
        /// </summary>
        public string Thumbnail
        {
            get { return _thumbnail; }
            set { _thumbnail = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column PromotionPercent in Table Products 
        /// </summary>
        public double PromotionPercent
        {
            get { return _promotionPercent; }
            set { _promotionPercent = value; }
        }

        #endregion

        #region IHydratable Implementation

        /// <summary>
        /// 
        /// </summary>        
        public void Fill(IDataReader oReader)
        {
            _id = int.Parse(oReader["Id"].ToString());
            _name = Convert.ToString(oReader["Name"]);
            _alia = Convert.ToString(oReader["Alia"]);
            _pagesCount = int.Parse(oReader["PagesCount"].ToString());
            _publisherId = Convert.ToString(oReader["PublisherId"]);
            _languageId = Convert.ToString(oReader["LanguageId"]);
            _coverType = Convert.ToString(oReader["CoverType"]);
            _size = Convert.ToString(oReader["Size"]);
            _weight = int.Parse(oReader["Weight"].ToString());
            _star = int.Parse(oReader["Star"].ToString());
            _voteCount = int.Parse(oReader["VoteCount"].ToString());
            _description = Convert.ToString(oReader["Description"]);
            _orginizePrice = decimal.Parse(oReader["OrginizePrice"].ToString());
            _price = decimal.Parse(oReader["Price"].ToString());
            _publishDate = DateTime.Parse(oReader["PublishDate"].ToString());
            _view = int.Parse(oReader["View"].ToString());
            _buy = int.Parse(oReader["Buy"].ToString());
            _tag = Convert.ToString(oReader["Tag"]);
            _createBy = Convert.ToString(oReader["CreateBy"]);
            _createDate = DateTime.Parse(oReader["CreateDate"].ToString());
            _lastestUpdate = DateTime.Parse(oReader["LastestUpdate"].ToString());
            _isHot = bool.Parse(oReader["IsHot"].ToString());
            _isFilter = bool.Parse(oReader["IsFilter"].ToString());
            _displayDate = DateTime.Parse(oReader["DisplayDate"].ToString());
            _status = bool.Parse(oReader["status"].ToString());
            _count = int.Parse(oReader["Count"].ToString());
            _available = int.Parse(oReader["Available"].ToString());
            _lastestBuy = DateTime.Parse(oReader["LastestBuy"].ToString());
            _parentId = int.Parse(oReader["ParentId"].ToString());
            _episode = short.Parse(oReader["Episode"].ToString());
            _type = byte.Parse(oReader["Type"].ToString());
            _thumbnail = Convert.ToString(oReader["Thumbnail"]);
            _promotionPercent = double.Parse(oReader["PromotionPercent"].ToString());
        }

        #endregion
    }
}